package com.crm.service.impl.productManager;

import com.crm.dao.mapper.productManager.CustomerMemberProductRelationMapper;
import com.crm.model.entity.memberManager.CustomerMemberCard;
import com.crm.model.entity.memberManager.CustomerMemberCardExample;
import com.crm.model.entity.productManager.CustomerMemberProductRelation;
import com.crm.service.orderManager.CustomerProductOrderDbService;
import com.crm.service.productManager.CustomerMemberCardServingDbService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author luojie
 * @date 2021/4/12 16:53
 */
@Service
public class CustomerMemberCardServingDbServiceImpl implements CustomerMemberCardServingDbService {

    @Autowired
    private CustomerMemberProductRelationMapper customerMemberProductRelationMapper;

    /***
     * @Description: 根据主键查询会员服务项
     * @Param: memberProductRelationId 主键
     * @Author: luojie
     * @Date: 2021/4/13 14:35
     */
    @Override
    public CustomerMemberProductRelation selectMemberCardServingById(String memberProductRelationId) {
        CustomerMemberProductRelation customerMemberProductRelation = customerMemberProductRelationMapper.selectByPrimaryKey(memberProductRelationId);
        return customerMemberProductRelation;
    }

    /***
     * @Description:新增会员服务项关系
     * @Param: 会员服务项关系实体
     * @Author: luojie
     * @Date: 2021/4/13 10:44
     */
    @Override
    public Boolean addMemberCardServing(CustomerMemberProductRelation customerMemberProductRelation) {
        int num = customerMemberProductRelationMapper.insertSelective(customerMemberProductRelation);
        return num>0;
    }

    /***
     * @Description:修改会员服务项关系
     * @Param: 会员服务项关系实体
     * @Author: luojie
     * @Date: 2021/4/13 10:44
     */
    @Override
    public Boolean updateMemberCardServing(CustomerMemberProductRelation customerMemberProductRelation) {
        int num = customerMemberProductRelationMapper.updateByPrimaryKeySelective(customerMemberProductRelation);
        return num>0;
    }
}
